import pymysql
conn=pymysql.connect(
    host='127.0.0.1',
    port=3306,
    user='root',
    password='root',
    db='face_recognition',
    charset='utf8'
)
     
    # 获取游标
cursor=conn.cursor()
     
    # 执行sql语句
sql='insert into white_face(id,name,arr) values(%s,%s,%s)'
rows=cursor.execute(sql,('','test','qzcsbj4'))
     
    # 提交
conn.commit()
     
    # 关闭游标
cursor.close()
     
    # 关闭连接
conn.close()